fix(cli): repair bundled resource monitor permissions - #5448
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved 20fe622 This is a narrow, self-contained bug fix that repairs bundled binaries lacking execute permissions. The change only affects bundled candidates (not user overrides), handles chmod failures gracefully, and includes a test covering the new behavior. You can customize Macroscope's approvability policy. Learn more. |
20fe622 to
2bc3280
Compare
Problem
On Linux, the Resource monitor diagnostics do not load. The Settings page reports Native unavailable and shows zeroed CPU, memory, process, and throughput values.
The native monitor binary is present at
dist/resource-monitor/linux-x64/t3-resource-monitor, but the npm package publishes it with mode0644instead of an executable mode. T3 detects the bundled binary, rejects it as non-executable, and therefore never starts the native telemetry process.This is not a CPU architecture, shared-library, or
noexecmount problem: the affected binary is a valid Linux x64 ELF and its required libraries are available.Fix
This lets the diagnostics sidecar start even when npm packaging removes executable permissions from native files.
Regression coverage
One focused test creates a bundled monitor fixture with mode
0644, verifies resolution repairs it, and verifies it becomes executable. Existing coverage continues to ensure a non-executable explicit override is rejected.Verification
vp test run apps/server/src/resourceTelemetry/ResourceMonitorBinary.test.ts— 6 passedReproduction
t3@0.0.31and the current nightly package both publish the Linux monitor without execute bits. After this change, retrying the monitor or restarting the server should populate the Resource monitor instead of showing Native unavailable.Note
Low Risk
Localized to monitor binary resolution on POSIX; only mutates bundled paths when missing execute bits, with existing override behavior preserved.
Overview
Fixes Linux Native unavailable diagnostics when the bundled
t3-resource-monitorships from npm with mode0644(no execute bit).ResourceMonitorBinarynow tags each resolve candidate as bundled vs override. On POSIX, if a bundled path exists but lacks execute permission, resolution chmods it (mode | 0o111) and re-stat before returning the path. Explicit paths (T3CODE_RESOURCE_MONITOR_PATH/ config) are unchanged—non-executable overrides still raiseResourceMonitorBinaryNotExecutable.Adds a test that simulates a
0644bundled binary and asserts resolve succeeds and the file becomes executable.Reviewed by Cursor Bugbot for commit 2bc3280. Bugbot is set up for automated code reviews on this repo. Configure here.